import React, { Component } from 'react';
import LoaderHelper from './loaderHelper';

class HopeBankLoader extends Component {
    componentDidMount() {
        const { widget } = this.props;
        let url = widget.custom ? widget.url : widget.stereoUrl;
        LoaderHelper.imageGeometryLoader(url, widget);
    }

    componentWillReceiveProps(nextProps) {
        if (nextProps.widget !== this.props.widget) {
            LoaderHelper.resetMeshItem(nextProps.widget, this.updateRedBag)
        }
    }
    
    //希望金币与红包共用
    updateRedBag(data) {
        var url = data.custom ? data.url : data.stereoUrl;
        LoaderHelper.imageGeometryLoader(url, data, true);
    }

    render() {
        return (<div />)
    }
}

export default HopeBankLoader;
